4.9.5 查询全量终端信息
请求参数
Path: /api/v1/device/queryAll
Method: POST
接口描述:
- 查询全量终端信息。
- 支持分页查询。
- 支持基于 资产类型、授信状态、在线状态、标签(支持多个过滤)、操作系统(支持多个过滤)进行过滤。
- 接口适用于 v2.2.7 及以上版本。
请求参数
Headers
| 参数名称 | 参数值 | 是否必须 | 示例 | 备注 |
|---|---|---|---|---|
| Content-Type | application/json | 必须 |
Body
| 名称 | 类型 | 是否必须 | 默认值 | 备注 | 其他信息 |
|---|---|---|---|---|---|
| assetType | string | 非必须 | 资产类型:'NONE' 未定义,'CYOD' 企业终端,'BYOD' 个人终端,'COPE' 企业纳管个人终端 | ||
| trusted | number | 非必须 | 授信状态:0 未授信,1 已授信 | ||
| onlineStatus | number | 非必须 | 在线状态:0 离线,1 在线 | ||
| loginStatus | number | 非必须 | 接入状态:0 未接入,1 已接入 | ||
| tagList | string[] | 非必须 | 标签名,支持多个过滤,不允许传入空数组 | ||
| osList | string[] | 非必须 | 操作系统,支持多个过滤:'Windows', 'macOS', '统信 UOS', '麒麟 Kylin', 'Android', 'iOS', 'HarmonyOS', 'iPadOS',不允许传入空数组 | ||
| pageSize | number | 非必须 | 20 | 分页大小,每页查询的最大数据量,越大查询时间越长,最大支持 1000 条 | |
| pageIndex | number | 非必须 | 1 | 页码 |
请求示例
{
"assetType": "CYOD",
"trusted": 1,
"onlineStatus": 1,
"loginStatus": 1,
"tagList": ["开发测试终端", "办公网终端"],
"osList": ["Windows", "macOS"],
"pageSize": 20,
"pageIndex": 1
}
返回数据:
| 名称 | 类型 | 是否必须 | 默认值 | 备注 | 其他信息 |
|---|---|---|---|---|---|
| code | number | 必须 | 返回码,0 返回成功 | ||
| data | object | 必须 | 响应数据 | ||
| ├─ totalCount | number | 必须 | 查询结果的数据总条数 | ||
| ├─ pageCount | number | 必须 | 查询结果的数据总页数 | ||
| ├─ pageSize | number | 必须 | 页大小,每页的最大数据数 | ||
| ├─ pageIndex | number | 必须 | 当前页码 | ||
| ├─ data | object[] | 必须 | 终端列表 | ||
| ├─├─ externalId | string | 必须 | 外部 ID | ||
| ├─├─ macList | string[] | 非必须 | MAC 地址列表 | ||
| ├─├─ deviceName | string | 必须 | 终端名称 | ||
| ├─├─ deviceType | string | 必须 | 设备类型:'PC' PC 端,'Mobile' 移动端 | ||
| ├─├─ assetType | string | 必须 | 资产类型:'CYOD' 企业终端,'BYOD' 个人终端,'COPE' 企业纳管个人终端,'NONE' 未定义 | ||
| ├─├─ tagList | string[] | 非必须 | 标签列表 | ||
| ├─├─ deviceBrand | string | 必须 | 品牌 | ||
| ├─├─ os | string | 必须 | 操作系统 | ||
| ├─├─ windowsDomain | string | 必须 | windows 域控 | 终端加入的域 | |
| ├─├─ onlineStatus | number | 必须 | 在线状态:0 离线 1 在线 | ||
| ├─├─ loginStatus | number | 必须 | 接入状态:0 未接入 1 已接入 | ||
| ├─├─ trusted | number | 必须 | 终端授信状态:0 未授信 1 已授信 | ||
| ├─├─ bindUsers | object[] | 非必须 | 绑定用户信息 | ||
| ├─├─├─ bindUser | string | 非必须 | 用户名 | ||
| ├─├─├─ bindType | string | 非必须 | 绑定方式:'userSelfBind' 自助绑定,'adminBind' 管理员绑定, 'adminAdmit' 管理员审批 | ||
| ├─├─├─ bindTime | string | 非必须 | 绑定时间 | ||
| ├─├─ historyUsers | object[] | 非必须 | 历史登录用户 | ||
| ├─├─├─ userName | string | 非必须 | 用户名 | ||
| ├─├─├─ displayName | string | 非必须 | 用户显示名 | ||
| ├─├─├─ userDescription | string | 非必须 | 用户描述 | ||
| ├─├─├─ userDirectoryName | string | 非必须 | 用户所属目录名 | ||
| ├─├─ clientVersion | string | 必须 | 客户端版本 | >=2.2.10 SP3 开始支持(2.2.12 除外) | |
| ├─├─ lastLoginUser | string | 必须 | 最后登录用户名 | >=2.2.10 SP3 开始支持(2.2.12 除外) | |
| ├─├─ displayName | string | 必须 | 最后登录用户显示名 | >=2.2.10 SP3 开始支持(2.2.12 除外) | |
| ├─├─ userDescription | string | 必须 | 最后登录用户描述 | >=2.2.10 SP3 开始支持(2.2.12 除外) | |
| ├─├─ userDirectoryName | string | 必须 | 最后登录用户所属目录 | >=2.2.10 SP3 开始支持(2.2.12 除外) | |
| ├─├─ userLoginDomain | string | 必须 | 最后登录用户所属目录 | >=2.5.16 | |
| ├─├─ lastActiveTime | string | 必须 | 设备最后活跃时间,例如: Thu Jun 12 2025 16:13:17 GMT+0800 (Coordinated Universal Time) |
>=2.5.16 | |
| ├─├─ lastLoginTime | string | 必须 | 用户最后登录时间,例如: Thu Jun 12 2025 16:13:17 GMT+0800 (Coordinated Universal Time) |
>=2.5.16 | |
| ├─├─ path | string | 必须 | 最后登录用户所属组织架构 | >=2.2.10 SP3 开始支持(2.2.12 除外) | |
| msg | string | 必须 | 描述信息 | ||
| traceId | string | 必须 | 调用链 ID,链路请求的标识 |
返回示例:
{
"code": 0,
"data": {
"totalCount": 100,
"pageCount": 20,
"pageSize": 20,
"pageIndex": 1,
"data": [
{
"externalId": "0c4e9039-f81d-11ec-a760-fefcfe545bb7",
"macList": ["FE-FC-FE-21-F5-D1", "FE-FC-FE-21-F5-D2"],
"deviceName": "DESKTOP-SDKLASKQ",
"assetType": "CYOD",
"deviceType": "PC",
"tagList": ["开发测试终端", "办公网终端"],
"deviceBrand": "SANGFOR",
"os": "windows 10",
"windowsDomain": "ADDOMAIN1",
"trusted": 1,
"bindUsers": [
{
"bindUser": "张三",
"bindType": "adminBind",
"bindTime": "Tue Jun 03 2022 20:22:08 GMT+0800 (Coordinated Universal Time)"
},
{
"bindUser": "李四",
"bindType": "adminAdmit",
"bindTime": "Tue Jun 03 2022 20:22:08 GMT+0800 (Coordinated Universal Time)"
}
],
"onlineStatus": 1,
"loginStatus": 1,
"historyUsers": [
{
"userName": "user1",
"userDirectoryName": "本地用户目录",
"displayName": "",
"userDescription": ""
},
{
"userName": "t1",
"userDirectoryName": "本地用户目录",
"displayName": "",
"userDescription": ""
}
],
"clientVersion": "2.2.10.2",
"lastLoginUser": "张三",
"displayName": "张三三",
"userDescription": "这是一名本地用户",
"userDirectoryName": "本地用户目录",
"path": "/"
},
{
"externalId": "6de9439834c9147569741d3c9c9fc011",
"macList": ["FE-FC-FE-21-F5-D3", "FE-FC-FE-21-F5-D4"],
"deviceName": "DESKTOP-SDKLAS11",
"assetType": "CYOD",
"deviceType": "PC",
"tagList": ["开发测试终端", "办公网终端"],
"deviceBrand": "SANGFOR",
"os": "windows 10",
"windowsDomain": "ADDOMAIN1",
"trusted": 1,
"bindUsers": [
{
"bindUser": "张三",
"bindType": "adminBind",
"bindTime": "Tue Jun 03 2022 20:22:08 GMT+0800 (Coordinated Universal Time)"
},
{
"bindUser": "李四",
"bindType": "adminAdmit",
"bindTime": "Tue Jun 03 2022 20:22:08 GMT+0800 (Coordinated Universal Time)"
}
],
"onlineStatus": 1,
"loginStatus": 1,
"historyUsers": [
{
"userName": "user1",
"userDirectoryName": "本地用户目录",
"displayName": "",
"userDescription": ""
},
{
"userName": "t1",
"userDirectoryName": "本地用户目录",
"displayName": "",
"userDescription": ""
}
],
"clientVersion": "2.2.10.2",
"lastLoginUser": "张三",
"displayName": "张三三",
"userDescription": "这是一名本地用户",
"userDirectoryName": "本地用户目录",
"path": "/"
}
]
},
"msg": "请求成功",
"traceId": "0022c672e4c8b0d6"
}
错误信息
| 错误提示 | 错误码 |
|---|---|
| 不支持的资产类型 | 7201 |
| 授信状态值错误 | 7201 |
| 在线状态值错误 | 7201 |
| 接入状态值错误 | 7201 |
| 标签只允许输入中文、字母、数字、下划线和横杠 | 7201 |
| 标签最多可输入%d 个字 | 7201 |
| 标签不能为空 | 7201 |
| 操作系统值错误 | 7201 |
| 操作系统不能为空 | 7201 |
| 分页索引必须大于 0 | 7201 |
| 分页大小:请输入 1-1000 区间值 | 7201 |